package com.qf.myexception;

import com.qf.utils.ResultMsg;
import org.springframework.web.bind.annotation.*;

@ControllerAdvice //异常处理器
@ResponseBody
public class MyExceptionHandler  {

    @ExceptionHandler(ServiceException.class)
    public ResultMsg getHandler(ServiceException e){
        return ResultMsg.FAILED(e.getCode(),e.getMessage());
    }

}
